var TSprite=cc.Node.extend({
	lastDel:0,//距离上一个动画帧的值
	curIndex:0,
	SFFList:null,
	SpriteList:null,
	init:function(){
		this.scheduleUpdate();
	},
	update:function(dt){//以秒为单位
		this._super();
		this.lastDel+=dt;

		var sffdata=this.SFFList[this.curIndex]
		if (this.lastDel>1/60*sffdata.delay)
		{
			//移除sprite
			this.lastDel=0;
			this.removeChild(this.SpriteList[this.curIndex]);
			this.curIndex+=1;
			if(this.curIndex>this.SFFList.length-1)
				this.curIndex=0;

			//下一帧sprite
			var frame=this.SpriteList[this.curIndex]
			sffdata=this.SFFList[this.curIndex]
			this.addChild(frame);
			//设置偏移，中心点
			frame.setPosition(-sffdata.anchor_x,sffdata.anchor_y);
		}
			
	},
	create:function(type){
		var typeStr=parseInt(type);

		this.init();
		this.SFFList=new Array();
		this.SpriteList=new Array();


		var sffdata=firstchar_sff[typeStr]
		for(i=0;i<sffdata.length;++i)
		{
			var spr=new SFFData(sffdata[i]);
			spr.filename="";
			this.SFFList[i]=spr;

			spr=cc.Sprite.createWithSpriteFrameName("first_"+typeStr+"_"+i+".png");
			spr.setAnchorPoint(0,1);
			this.SpriteList[i]=spr;
		}
		this.addChild(this.SpriteList[0]);
		this.curIndex=0
	}
});